package com.isunland.managesystem.ui;

import android.app.Activity;
import android.content.Intent;
import android.support.v4.app.Fragment;
import com.isunland.managesystem.entity.BaseParams;
import com.isunland.managesystem.entity.CarUsed;

/**
 * 对象功能:
 * 开发公司: 北京信普达系统工程有限公司
 * 开发人员: HuXiaoDan
 * 创建时间: 2017/4/6 14:44
 */
public class CarUsedListActivity extends SingleFragmentActivity {
  @Override protected Fragment createFragment() {
    BaseParams params =
        (BaseParams) getIntent().getSerializableExtra(CarUsedListFragment.EXTRA_PARAMS);
    CarUsed content = (CarUsed) getIntent().getSerializableExtra(CarUsedListFragment.EXTRA_CONTENT);
    return CarUsedListFragment.newInstance(params, content);
  }

  public static void newInstance(Fragment fragment, Activity context, int requestCode,
      BaseParams params, CarUsed content) {
    if (fragment == null || context == null) return;
    Intent i = new Intent(context, CarUsedListActivity.class);
    i.putExtra(CarUsedListFragment.EXTRA_PARAMS, params);
    i.putExtra(CarUsedListFragment.EXTRA_CONTENT, content);
    fragment.startActivityForResult(i, requestCode);
  }

  public static void newInstance(Fragment fragment, Activity context, int requestCode,
      BaseParams params) {
    if (fragment == null || context == null) return;
    Intent i = new Intent(context, CarUsedListActivity.class);
    i.putExtra(CarUsedListFragment.EXTRA_PARAMS, params);
    fragment.startActivityForResult(i, requestCode);
  }
}
